package com.qn.pipeline2.context;

import com.only4play.order.commons.constants.BizEnum;
import com.only4play.order.commons.filters.selector.FilterSelector;
import com.only4play.order.commons.model.AbstractOrderContext;
import lombok.Getter;
import lombok.Setter;

import java.util.Map;

/**
 * 模型实例构建的上下文
 */
@Getter
@Setter
public class InstanceBuildContext extends AbstractOrderContext {

    private boolean continueFlag = true;

    private boolean preview;

    /**
     * 模型 id
     */
    private Long modelId;

    /**
     * 用户 id
     */
    private long userId;

    /**
     * 表单输入
     */
    private Map<String, Object> formInput;

    /**
     * 保存模型实例完成后，记录下 id
     */
    private Long instanceId;

    /**
     * 模型创建出错时的错误信息
     */
    private String errorMsg;

    public InstanceBuildContext(BizEnum bizEnum, FilterSelector selector) {
        super(bizEnum, selector);
    }

    // 其他参数

    @Override
    public boolean continueChain() {
        return continueFlag;
    }
}
